home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Shareware Plus / Developers / The Gray Council 1.2.1 / source / MacApp / GrayCouncilMA.h < prev   
Encoding:
Text File  |  1996-11-07  |  39.1 KB  |  1,178 lines  |  [TEXT/CWIE]

  1. //
  2. // The Gray Council MacApp Adapter
  3. // Copyright ©1996 by Trygve Isaacson. All Rights Reserved.
  4. //
  5. // MacApp adapter classes for The Gray Council core classes.
  6. //
  7. // Before using any of the Gray Council source code, read and
  8. // follow the licensing info in the accompanying documentation
  9. // or contact:
  10. //   <trygve@bombaydigital.com>
  11. //   <http://www.bombaydigital.com>
  12. //
  13. // Also check the web site above to make sure you have the latest version!
  14. //
  15. // The Gray Council provides a set of standard C++ classes that implement
  16. // the standard Apple Grayscale Appearance. The core classes do not
  17. // require any other code such as a particular class framework.
  18. //
  19. // This file defines a set of helper classes that derive from standard
  20. // MacApp view classes, and interface with the core Gray Council code.
  21. // There are also a couple of adorner subclasses for attaching to windows
  22. // and list boxes to get the correct background color or target border.
  23. //
  24. // Normally, to use a Gray Council MacApp class, you can simply change the
  25. // class name of the subview in your resource file or AdLib view to the
  26. // class name of the appropriate Gray Council MacApp adapter class. For
  27. // example, to use the GC pushbutton, create a normal TButton subview,
  28. // and set its class name to AGAPushButtonMA. Voila.
  29. //
  30. // A couple of the classes use the userData field of the subview to specify
  31. // additional information such as icon IDs, string resource IDs, etc.
  32. //
  33. // To statically instantiate one of these MacApp subclasses at runtime,
  34. // not via a view resource, use the class' supplied "I" method.
  35. //
  36. // Each class here that interfaces to a core AGAObject has a public
  37. // member variable called mAGAObject that points to the actual AGAObject
  38. // subclass object. Certain extended object settings (such as mixed-state
  39. // buttons, proportional and live scrolling, etc.) require you to call
  40. // the AGAObject to set it. The member variable is made public to keep
  41. // these MacApp classes as lightweight as possible; you make the call,
  42. // rather than using myriad new functions of the MacApp AGA subclasses.
  43. //
  44. // Classes defined below:
  45. //    AGAPushButtonMA -- TButton subclass for AGAPushButton
  46. //    AGACheckBoxMA -- TCheckBox subclass for AGACheckBox
  47. //    AGARadioButtonMA -- TRadio subclass for AGARadioButton
  48. //    AGAIconPushButtonMA -- AGAPushButtonMA (TButton) subclass for AGAIconPushButton
  49. //    AGAIconCheckBoxMA -- AGACheckBoxMA (TCheckBox) subclass for AGAIconCheckBox
  50. //    AGAIconRadioButtonMA -- AGARadioButtonMA (TRadio) subclass for AGAIconRadioButton
  51. //    AGAScrollBarMA -- TScrollBar subclass for AGAScrollBar
  52. //    AGAScrollerScrollBarMA -- TScrollerScrollBar subclass for AGAScrollBar
  53. //        Remember the difference between TScrollBar and TScrollerScrollBar!
  54. //    AGASliderMA -- TControl subclass for AGASlider
  55. //    AGABackgroundAdornerMA -- TAdorner subclass that you should attach to
  56. //        typical modeless windows; gives it the proper modeless gray background
  57. //    AGAModalBackgroundAdornerMA -- AGABackgroundAdornerMA (TAdorner) subclass
  58. //        that you should attach to modal windows (i.e., things you PoseModally);
  59. //        gives it the proper modal gray background; however, for dBoxProc and
  60. //        moveableDBoxProc windows, leaves window structure region white, so
  61. //        you may prefer to use AGAFlatBackgroundBehaviorMA in these cases
  62. //    AGAFlatBackgroundBehaviorMA -- TBehavior subclass that you should attach
  63. //        to modal windows (i.e., things you PoseModally); gives it the proper
  64. //        gray background, including the window structure region, but without
  65. //        raised edges
  66. //    AGAWhiteBackgroundAdornerMA -- TAdorner subclass you should attach to any
  67. //        view that needs a white background but lives in a gray background window
  68. //        (e.g., TEditText, TScroller containing grid, etc.)
  69. //    AGANotchedWhiteBackgroundAdornerMA -- AGAWhiteBackgroundAdornerMA (TAdorner)
  70. //        subclass that leaves a notch in the bottom right corner, such as the
  71. //        notch left by a pair of scroll bars
  72. //    AGABorderFrameAdornerMA -- TAdorner subclass that you can attach to any
  73. //        view that needs a "3D" sunken frame around it (e.g., the same things
  74. //        that need a white background adorner)
  75. //    AGANotchedBorderFrameAdornerMA -- AGABorderFrameAdornerMA (TAdorner) subclass
  76. //        that leaves a notch in the bottom right corner, such as the notch left by
  77. //        a pair of scroll bars
  78. //    AGAPopupMA -- TPopup subclass for AGAPopupMenu
  79. //    AGAStaticTextMA -- TStaticText subclass for AGAStaticText 
  80. //    AGALittleArrowsMA -- TControl subclass for AGALittleArrows
  81. //    AGADisclosureTriangleMA -- TControl subclass for AGADisclosureTriangle
  82. //    AGAProgressIndicatorMA -- TControl subclass for AGAProgressIndicator
  83. //    AGASeparatorMA -- TView subclass for AGASeparator
  84. //    AGATargetBorderViewMA -- TTargetBorderView subclass that draws AGA-style
  85. //        target border frame
  86. //    AGANotchedTargetBorderViewMA -- AGATargetBorderViewMA (TTargetBorderView) subclass
  87. //        that leaves a notch in the bottom right corner, such as the notch left by a
  88. //        pair of scroll bars
  89. //    AGATargetBorderFrameViewMA -- AGATargetBorderViewMA (TTargetBorderView)
  90. //        subclass that draws a "3D" sunken frame just like an AGABorderFrameAdornerMA
  91. //        in addition to the AGA-compatible TTargetBorderView.
  92. //    AGATargetBorderFrameViewMA -- AGATargetBorderFrameViewMA (TTargetBorderView)
  93. //        subclass that leaves a notch in the bottom right corner, such as the notch
  94. //        left by a pair of scroll bars
  95. //    AGAGroupBoxMA -- TCluster subclass for AGAGroupBox
  96. //    AGASecondaryGroupBoxMA -- AGAClusterMA (TCluster) subclass for AGAGroupBox
  97. //        with secondary box style set
  98. //    AGATabPanelMA -- TControl subclass for AGATabPanel set for large tabs.
  99. //    AGASmallTabPanelMA -- AGATabPanelMA (TControl) subclass for AGATabPanel
  100. //        set for small tabs.
  101. //
  102.  
  103. #pragma once
  104.  
  105. #ifndef __GRAYCOUNCILMA__
  106. #define __GRAYCOUNCILMA__
  107.  
  108. #include "GrayCouncil.h"
  109. #include "UDialog.h"
  110.  
  111. //
  112. // You must call InitGrayCouncilMA after initializing the MacApp and the
  113. // Toolbox and before instantiating any GrayCouncil objects. This routine
  114. // registers the MacApp classes and then calls the core InitGrayCouncil
  115. // function for you. If it returns an error, you should quit. The only
  116. // current error situation of this is an out-of-memory condition
  117. // during initialization.
  118. // Alternatively, you can manually register just the adapter classes that
  119. // you will use, and then call InitGrayCouncil.
  120. //
  121.  
  122. extern OSErr InitGrayCouncilMA();
  123.  
  124. #pragma mark AGAPushButtonMA
  125.  
  126. //
  127. // AGAPushButtonMA ----------------------------------------------------
  128. //
  129. // TButton replacement subclass. Automatically detects presence of a
  130. // TRRectAdorner to make the AGAPushButton take on the default button
  131. // appearance. You could also set kIsDefault state manually.
  132. //
  133.  
  134. class AGAPushButtonMA : public TButton
  135.     {
  136.     MA_DECLARE_CLASS;
  137.  
  138.     public:
  139.  
  140.         AGAPushButtonMA();
  141.         virtual ~AGAPushButtonMA();
  142.  
  143.         // TButton-compatible I method
  144.         void IAGAPushButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
  145.  
  146.         // MacApp overrides
  147.         virtual void DoPostCreate(TDocument* itsDocument);
  148.         virtual void Draw(const VRect& area);
  149.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  150.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  151.         virtual void HiliteState(Boolean state, Boolean redraw);
  152.         virtual void Hilite();
  153.         virtual void DimState(Boolean state, Boolean redraw);
  154.         virtual void Dim();
  155.         virtual void SetEnable(Boolean state);
  156.         virtual void SetText(const CStr255& itsText, Boolean redraw);
  157.  
  158.         AGAPushButton*    mAGAObject;
  159.  
  160.     protected:
  161.  
  162.         virtual void CreateAGAObject();
  163.  
  164.         TAdorner*    FindRRectAdorner();
  165.     };
  166.  
  167. #pragma mark AGACheckBoxMA
  168.  
  169. //
  170. // AGACheckBoxMA ----------------------------------------------------
  171. //
  172. // TCheckBox replacement subclass. To use mixed-state capability,
  173. // set/get the AGACheckBox state directly.
  174. //
  175.  
  176. class AGACheckBoxMA : public TCheckBox
  177.     {
  178.     MA_DECLARE_CLASS;
  179.  
  180.     public:
  181.  
  182.         AGACheckBoxMA();
  183.         virtual ~AGACheckBoxMA();
  184.  
  185.         // TCheckBox-compatible I method
  186.         void IAGACheckBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  187.  
  188.         // MacApp overrides
  189.         virtual void DoPostCreate(TDocument* itsDocument);
  190.         virtual void Draw(const VRect& area);
  191.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  192.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  193.         virtual void HiliteState(Boolean state, Boolean redraw);
  194.         virtual void Hilite();
  195.         virtual void DimState(Boolean state, Boolean redraw);
  196.         virtual void Dim();
  197.         virtual void SetEnable(Boolean state);
  198.         virtual void SetText(const CStr255& itsText, Boolean redraw);
  199.         virtual Boolean IsOn();
  200.         virtual void SetState(Boolean state, Boolean redraw);
  201.         virtual void Toggle(Boolean redraw);
  202.         virtual void ToggleIf(Boolean matchState, Boolean redraw);
  203.  
  204.         AGACheckBox*    mAGAObject;
  205.  
  206.     protected:
  207.  
  208.         virtual void CreateAGAObject();
  209.     };
  210.  
  211. #pragma mark AGARadioButtonMA
  212.  
  213. //
  214. // AGARadioButtonMA ----------------------------------------------------
  215. //
  216. // TRadio replacement subclass. To use mixed-state capability,
  217. // set/get the AGARadioButton state directly.
  218. //
  219.  
  220. class AGARadioButtonMA : public TRadio
  221.     {
  222.     MA_DECLARE_CLASS;
  223.  
  224.     public:
  225.  
  226.         AGARadioButtonMA();
  227.         virtual ~AGARadioButtonMA();
  228.  
  229.         // TRadio-compatible I method
  230.         void IAGARadioButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  231.  
  232.         // MacApp overrides
  233.         virtual void DoPostCreate(TDocument* itsDocument);
  234.         virtual void Draw(const VRect& area);
  235.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  236.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  237.         virtual void HiliteState(Boolean state, Boolean redraw);
  238.         virtual void Hilite();
  239.         virtual void DimState(Boolean state, Boolean redraw);
  240.         virtual void Dim();
  241.         virtual void SetEnable(Boolean state);
  242.         virtual void SetText(const CStr255& itsText, Boolean redraw);
  243.         virtual Boolean IsOn();
  244.         virtual void SetState(Boolean state, Boolean redraw);
  245.         virtual void Toggle(Boolean redraw);
  246.         virtual void ToggleIf(Boolean matchState, Boolean redraw);
  247.  
  248.         AGARadioButton*    mAGAObject;
  249.  
  250.     protected:
  251.  
  252.         virtual void CreateAGAObject();
  253.     };
  254.  
  255. #pragma mark AGAIconPushButtonMA
  256.  
  257. //
  258. // AGAIconPushButtonMA ----------------------------------------------------
  259. //
  260. // TButton replacement subclass that implements an icon button that behaves
  261. // like a TButton -- you click it and it sends its fEventNumber. When
  262. // instantiated from a view resource, the fUserArea is used to obtain the
  263. // button's icon ID. You can also set the icon ID of the AGAIconPushButton
  264. // directly (cast the mAGAObject to AGAIconPushButton*).
  265. //
  266.  
  267. class AGAIconPushButtonMA : public AGAPushButtonMA
  268.     {
  269.     MA_DECLARE_CLASS;
  270.  
  271.         // TButton-compatible I method
  272.         void IAGAIconPushButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
  273.  
  274.     protected:
  275.  
  276.         // AGAPushButtonMA override
  277.         virtual void CreateAGAObject();
  278.     };
  279.  
  280. #pragma mark AGAIconCheckBoxMA
  281.  
  282. //
  283. // AGAIconCheckBoxMA ----------------------------------------------------
  284. //
  285. // TCheckBox replacement subclass that implements an icon button that behaves
  286. // like a check box -- you click it and it toggles its on/off state. When
  287. // instantiated from a view resource, the fUserArea is used to obtain the
  288. // button's icon ID. You can also set the icon ID of the AGAIconCheckBox
  289. // directly (cast the mAGAObject to AGAIconCheckBox*). If you want the on/off
  290. // states to have different icons, you can specify different icon IDs.
  291. //
  292.  
  293. class AGAIconCheckBoxMA : public AGACheckBoxMA
  294.     {
  295.     MA_DECLARE_CLASS;
  296.  
  297.         // TCheckBox-compatible I method
  298.         void IAGAIconCheckBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  299.  
  300.     protected:
  301.  
  302.         // AGACheckBoxMA override
  303.         virtual void CreateAGAObject();
  304.     };
  305.  
  306. #pragma mark AGAIconRadioButtonMA
  307.  
  308. //
  309. // AGAIconRadioButtonMA ----------------------------------------------------
  310. //
  311. // TRadio replacement subclass that implements an icon button that behaves
  312. // like a radio button -- you click it and it turns on, and notifies its
  313. // cluster so that the others in its group are turned off. When
  314. // instantiated from a view resource, the fUserArea is used to obtain the
  315. // button's icon ID. You can also set the icon ID of the AGAIconRadioButton
  316. // directly (cast the mAGAObject to AGAIconRadioButton*). If you want the on/off
  317. // states to have different icons, you can specify different icon IDs.
  318. //
  319.  
  320. class AGAIconRadioButtonMA : public AGARadioButtonMA
  321.     {
  322.     MA_DECLARE_CLASS;
  323.  
  324.         // TRadio-compatible I method
  325.         void IAGAIconRadioButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  326.  
  327.     protected:
  328.  
  329.         // AGARadioButtonMA override
  330.         virtual void CreateAGAObject();
  331.     };
  332.  
  333. #pragma mark AGAScrollBarMA
  334.  
  335. //
  336. // AGAScrollBarMA ----------------------------------------------------
  337. //
  338. // TScrollBar replacement subclass. To use live scrolling, set the
  339. // AGAScrollBar state directly and either install a notification routine
  340. // or handle the scroll bar's fEventNumber by checking the current value.
  341. // To use proportional indicator, set the AGAScrollBar state directly.
  342. //
  343. // Please note that TScrollBar and TScrollerScrollBar are different!
  344. //
  345.  
  346. typedef void (*AGANotifyMAPtr)(TView* theIndicator, SInt32 dataValue, void* userData);
  347.  
  348. class AGAScrollBarMA : public TScrollBar
  349.     {
  350.     MA_DECLARE_CLASS;
  351.  
  352.     public:
  353.  
  354.         AGAScrollBarMA();
  355.         virtual ~AGAScrollBarMA();
  356.  
  357.         // TScrollBar-compatible I method
  358.         void IAGAScrollBarMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, VHSelect itsDirection, long itsVal, long itsMin, long itsMax);
  359.  
  360.         // MacApp overrides
  361.         virtual void DoPostCreate(TDocument* itsDocument);
  362.         virtual void Draw(const VRect& area);
  363.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  364.         virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);
  365.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  366.         virtual void HiliteState(Boolean state, Boolean redraw);
  367.         virtual void Hilite();
  368.         virtual void DimState(Boolean state, Boolean redraw);
  369.         virtual void Dim();
  370.         virtual void SetEnable(Boolean state);
  371.         virtual void Activate(Boolean entering);
  372.         virtual void SetLongMax(VCoordinate itsMax, Boolean redraw);
  373.         
  374.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  375.         virtual void    HandleNotification(SInt32 dataValue);
  376.         
  377.         AGANotifyMAPtr    mNotificationRoutine;
  378.         void*            mUserData;
  379.  
  380.         AGAScrollBar*    mAGAObject;
  381.  
  382.     protected:
  383.  
  384.         virtual void CreateAGAObject();
  385.         
  386.         static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
  387.     };
  388.  
  389. #pragma mark AGAScrollerScrollBarMA
  390.  
  391. //
  392. // AGAScrollerScrollBarMA ----------------------------------------------------
  393. //
  394. // TScrollerScrollBar replacement subclass. To use live scrolling, just set
  395. // the AGAScrollBar state directly; the scroller will get the live scroll
  396. // nofication messages automatically. To use proportional indicator,
  397. // set the AGAScrollBar state directly.
  398. //
  399. // Please note that TScrollBar and TScrollerScrollBar are different!
  400. //
  401.  
  402. class AGAScrollerScrollBarMA : public TScrollerScrollBar
  403.     {
  404.     MA_DECLARE_CLASS;
  405.  
  406.     public:
  407.  
  408.         AGAScrollerScrollBarMA();
  409.         virtual ~AGAScrollerScrollBarMA();
  410.  
  411.         // TScrollerScrollBar-compatible I method
  412.         void IAGAScrollerScrollBarMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, VHSelect itsDirection, long itsMax, TScroller* itsScroller);
  413.  
  414.         // MacApp overrides
  415.         virtual void DoPostCreate(TDocument* itsDocument);
  416.         virtual void Draw(const VRect& area);
  417.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  418.         virtual void AttachScroller(TScroller* itsScroller);
  419.         virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);
  420.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  421.         virtual void HiliteState(Boolean state, Boolean redraw);
  422.         virtual void Hilite();
  423.         virtual void DimState(Boolean state, Boolean redraw);
  424.         virtual void Dim();
  425.         virtual void SetEnable(Boolean state);
  426.         virtual void Activate(Boolean entering);
  427.         virtual void SetLongMax(VCoordinate itsMax, Boolean redraw);
  428.         
  429.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  430.         virtual void    HandleNotification(SInt32 dataValue);
  431.         virtual void    UpdateScrollAmounts();
  432.         
  433.         AGANotifyMAPtr    mNotificationRoutine;
  434.         void*            mUserData;
  435.  
  436.         AGAScrollBar*    mAGAObject;
  437.  
  438.     protected:
  439.  
  440.         virtual void CreateAGAObject();
  441.         
  442.         static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
  443.     };
  444.  
  445. #pragma mark AGASliderMA
  446.  
  447. //
  448. // AGASliderMA ----------------------------------------------------
  449. //
  450. // TControl subclass. To set/get the value, access the AGASlider
  451. // directly. When instantiated from a view resource, the fUserArea,
  452. // if non-zero, is used as the resource ID of an 'STR#' resource
  453. // that contains the slider labels; in this case, the range is
  454. // automatically set to match the number of labels, and the slider
  455. // will have a pointy indicator. If the ID is zero or invalid, the
  456. // slider will be rectangular.
  457. //
  458.  
  459. class AGASliderMA : public TControl
  460.     {
  461.     MA_DECLARE_CLASS;
  462.  
  463.     public:
  464.  
  465.         AGASliderMA();
  466.         virtual ~AGASliderMA();
  467.  
  468.         // TControl-compatible I method
  469.         void IAGASliderMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  470.  
  471.         // MacApp overrides
  472.         virtual void DoPostCreate(TDocument* itsDocument);
  473.         virtual void Draw(const VRect& area);
  474.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  475.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  476.         virtual void DimState(Boolean state, Boolean redraw);
  477.         virtual void Dim();
  478.         virtual void SetEnable(Boolean state);
  479.  
  480.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  481.         virtual void    HandleNotification(SInt32 dataValue);
  482.         
  483.         AGANotifyMAPtr    mNotificationRoutine;
  484.         void*            mUserData;
  485.  
  486.         AGASlider*    mAGAObject;
  487.  
  488.     protected:
  489.  
  490.         virtual void CreateAGAObject();
  491.         
  492.         static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
  493.     };
  494.  
  495. #pragma mark AGABackgroundAdornerMA
  496.  
  497. //
  498. // AGABackgroundAdornerMA ----------------------------------------------------
  499. //
  500. // An adorner that you should attach to typical modeless windows if you
  501. // want the standard AGA gray background. It should be placed BEFORE the
  502. // "Draw Adorner".
  503. //
  504.  
  505. class AGABackgroundAdornerMA : public TAdorner
  506.     {
  507.     MA_DECLARE_CLASS;
  508.  
  509.     public:
  510.  
  511.         AGABackgroundAdornerMA();
  512.  
  513.         // MacApp overrides
  514.         virtual void DoHighlightSelection(TView* itsView, const VRect& area, HLState fromHL, HLState toHL);
  515.         virtual void Draw(TView* itsView, const VRect& area);
  516.         virtual void ViewChangedFrame(TView* itsView, const VRect& oldFrame, const VRect& newFrame, Boolean    invalidate);
  517.         virtual void AddedToView(TView* itsView);
  518.  
  519.     protected:
  520.  
  521.         virtual void DrawBackground(TView* itsView, const VRect& area, Boolean fill, Boolean active);
  522.         virtual Boolean HasGrowBox(TView* itsView);
  523.  
  524.         AGABackgroundKind    mBackgroundKind;
  525.     };
  526.  
  527. #pragma mark AGAModalBackgroundAdornerMA
  528.  
  529. //
  530. // AGAModalBackgroundAdornerMA ----------------------------------------------------
  531. //
  532. // An adorner that you should attach to typical modal windows (dialogs)
  533. // in order to get the standard AGA modal gray background. It should be placed
  534. // BEFORE the "Draw Adorner".
  535. //
  536. // Usage note: This adorner draws the raised gray background in the window
  537. // content region. Some window kinds (notably dBoxProc and movableDBoxProc
  538. // for modal dialogs) pad the window frame with a few pixels around the edge
  539. // of the content area. This adorner will leave a white ring around the usable
  540. // content area, because you can't draw outside it.
  541. // If you want a solid gray background with these kinds of windows, use an
  542. // AGAFlatBackgroundBehaviorMA attached to the window. It will install the
  543. // gray background into the window's color table, so that gray is drawn in
  544. // the area outside the content region.
  545. //
  546.  
  547. class AGAModalBackgroundAdornerMA : public AGABackgroundAdornerMA
  548.     {
  549.     MA_DECLARE_CLASS;
  550.  
  551.     public:
  552.  
  553.         AGAModalBackgroundAdornerMA();
  554.     };
  555.  
  556. #pragma mark AGAFlatBackgroundBehaviorMA
  557.  
  558. //
  559. // AGAFlatBackgroundBehaviorMA ----------------------------------------------------
  560. //
  561. // TBehavior subclass that handles DoPostCreate by installing a gray
  562. // background color in the owner's window color table.
  563. // This MUST be only attached to a TWindow or TView in a window.
  564. // The reason we use a behavior rather than an adorner, is that adorners
  565. // don't get notified in a timely fashion when they are attached to the
  566. // host view, while behaviors get a DoPostCreate call, which is at the
  567. // right time to install the color.
  568. //
  569.  
  570. class AGAFlatBackgroundBehaviorMA : public TBehavior
  571.     {
  572.     MA_DECLARE_CLASS;
  573.  
  574.     public:
  575.  
  576.         AGAFlatBackgroundBehaviorMA();
  577.         virtual ~AGAFlatBackgroundBehaviorMA();
  578.  
  579.         // MacApp overrides
  580.         virtual void DoPostCreate(TDocument* itsDocument);
  581.     };
  582.  
  583. #pragma mark AGAWhiteBackgroundAdornerMA
  584.  
  585. //
  586. // AGAWhiteBackgroundAdornerMA ----------------------------------------------------
  587. //
  588. // An adorner that you should attach to any subview where the window has
  589. // a gray background but the particular subview needs a white background.
  590. // Editable text fields and list boxes are the most common examples. It should
  591. // be placed BEFORE the "Draw Adorner".
  592. //
  593.  
  594. class AGAWhiteBackgroundAdornerMA : public TAdorner
  595.     {
  596.     MA_DECLARE_CLASS;
  597.  
  598.     public:
  599.  
  600.         // MacApp overrides
  601.         virtual void Draw(TView* itsView, const VRect& area);
  602.     };
  603.  
  604. #pragma mark AGANotchedWhiteBackgroundAdornerMA
  605.  
  606. //
  607. // AGANotchedWhiteBackgroundAdornerMA ----------------------------------------------------
  608. //
  609. // Same as AGAWhiteBackgroundAdornerMA, but leaves a "notch" in bottom
  610. // right corner for area created by a pair of scroll bars.
  611. //
  612.  
  613. class AGANotchedWhiteBackgroundAdornerMA : public TAdorner
  614.     {
  615.     MA_DECLARE_CLASS;
  616.  
  617.     public:
  618.  
  619.         // MacApp overrides
  620.         virtual void Draw(TView* itsView, const VRect& area);
  621.     };
  622.  
  623. #pragma mark AGABorderFrameAdornerMA
  624.  
  625. //
  626. // AGABorderFrameAdornerMA ----------------------------------------------------
  627. //
  628. // An adorner that you should attach to any subview where the subview
  629. // needs a "3D" sunken frame around it. Editable text fields and list
  630. // boxes are the most common examples. It should be placed AFTER the
  631. // "Draw Adorner".
  632. //
  633.  
  634. class AGABorderFrameAdornerMA : public TAdorner
  635.     {
  636.     MA_DECLARE_CLASS;
  637.  
  638.     public:
  639.  
  640.         // MacApp overrides
  641.         virtual void Draw(TView* itsView, const VRect& area);
  642.     };
  643.  
  644. #pragma mark AGANotchedBorderFrameAdornerMA
  645.  
  646. //
  647. // AGANotchedBorderFrameAdornerMA ----------------------------------------------------
  648. //
  649. // An adorner that you should attach to any subview where you want a
  650. // "3D" sunken frame around it, contoured to fit the "notch" at the
  651. // bottom right of a pair of scroll bars.
  652. //
  653.  
  654. class AGANotchedBorderFrameAdornerMA : public TAdorner
  655.     {
  656.     MA_DECLARE_CLASS;
  657.  
  658.     public:
  659.  
  660.         // MacApp overrides
  661.         virtual void Draw(TView* itsView, const VRect& area);
  662.     };
  663.  
  664. #pragma mark AGAPopupMA
  665.  
  666. //
  667. // AGAPopupMA ----------------------------------------------------
  668. //
  669. // TPopup replacement subclass.
  670. //
  671.  
  672. class AGAPopupMA : public TPopup
  673.     {
  674.     MA_DECLARE_CLASS;
  675.  
  676.     public:
  677.  
  678.         AGAPopupMA();
  679.         virtual ~AGAPopupMA();
  680.  
  681.         // TPopup-compatible I method
  682.         void IAGAPopupMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, short itsMenuID, short itsCurrentItem, short itsItemOffset, short itsStrListID, short itsIndex, short itsStyle, short itsJust, Boolean useAddResMenu, ResType useAddResMenuResType, const TextStyle& itsTextStyle = gSystemStyle);
  683.  
  684.         // MacApp overrides
  685.         virtual void DoPostCreate(TDocument* itsDocument);
  686.         virtual void Draw(const VRect& area);
  687.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  688.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  689.         virtual void DimState(Boolean state, Boolean redraw);
  690.         virtual void Dim();
  691.         virtual void SetEnable(Boolean state);
  692.         
  693.         // TPopup and TControl overrides
  694.         virtual void AttachMenuRef(MenuRef itsMenuRef);                // installs the menu
  695.         virtual void SetText(const CStr255& title, Boolean redraw);    // sets the popup title
  696.         virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);// sets cur item no
  697.         virtual SInt16 GetVal();                                    // gets cur item no
  698.  
  699.         AGAPopupMenu*    mAGAObject;
  700.  
  701.     protected:
  702.  
  703.         virtual void CreateAGAObject();
  704.     };
  705.  
  706. #pragma mark AGAStaticTextMA
  707.  
  708. //
  709. // AGAStaticTextMA ----------------------------------------------------
  710. //
  711. // TStaticText replacement subclass. Dims with gray text instead of
  712. // patBic gray pattern erasing; suppresses erasing background to white
  713. // when text is changed.
  714. //
  715.  
  716. class AGAStaticTextMA : public TStaticText
  717.     {
  718.     MA_DECLARE_CLASS;
  719.  
  720.     public:
  721.  
  722.         AGAStaticTextMA();
  723.         virtual ~AGAStaticTextMA();
  724.  
  725.         // TStaticText-compatible I method
  726.         void IAGAStaticTextMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
  727.  
  728.         // MacApp overrides
  729.         virtual void DoPostCreate(TDocument* itsDocument);
  730.         virtual void Draw(const VRect& area);
  731.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  732.         virtual void DimState(Boolean state, Boolean redraw);
  733.         virtual void Dim();
  734.         virtual void SetText(const CStr255& theText, Boolean redraw);
  735.  
  736.         AGAStaticText*    mAGAObject;
  737.  
  738.     protected:
  739.  
  740.         virtual void CreateAGAObject();
  741.     };
  742.  
  743. #pragma mark AGALittleArrowsMA
  744.  
  745. //
  746. // AGALittleArrowsMA ----------------------------------------------------
  747. //
  748. // TControl subclass. You will need to either install a notification
  749. // routine to respond to arrow tracking, or subclass and override
  750. // the HandleNotification member function. However:
  751. //
  752. // If you simply want to link the little arrows to a TNumberText
  753. // field, just put the TNumberText's view ID the little arrows view's
  754. // fUserArea, and the arrows will automatically increment/decrement
  755. // the TNumberText view's value.
  756. //
  757.  
  758. class AGALittleArrowsMA : public TControl
  759.     {
  760.     MA_DECLARE_CLASS;
  761.  
  762.     public:
  763.  
  764.         AGALittleArrowsMA();
  765.         virtual ~AGALittleArrowsMA();
  766.  
  767.         // TControl-compatible I method
  768.         void IAGALittleArrowsMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  769.  
  770.         // MacApp overrides
  771.         virtual void DoPostCreate(TDocument* itsDocument);
  772.         virtual void Draw(const VRect& area);
  773.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  774.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  775.         virtual void DimState(Boolean state, Boolean redraw);
  776.         virtual void Dim();
  777.         virtual void SetEnable(Boolean state);
  778.         
  779.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  780.         virtual void    HandleNotification(SInt32 deltaValue);
  781.         
  782.         AGANotifyMAPtr    mNotificationRoutine;
  783.         void*            mUserData;
  784.  
  785.         AGALittleArrows*    mAGAObject;
  786.  
  787.     protected:
  788.  
  789.         virtual void CreateAGAObject();
  790.         
  791.         static void RealAGANotifier(AGALittleArrows* theAGAObject, SInt32 deltaValue, void* userData);
  792.  
  793.         TNumberText*    mLinkedNumberText;
  794.     };
  795.  
  796. #pragma mark AGADisclosureTriangleMA
  797.  
  798. //
  799. // AGADisclosureTriangleMA ----------------------------------------------------
  800. //
  801. // TControl subclass. Set/get the AGADisclosureTriangle state
  802. // directly. Think of it as a check box -- it's either on or off.
  803. //
  804.  
  805. class AGADisclosureTriangleMA : public TControl
  806.     {
  807.     MA_DECLARE_CLASS;
  808.  
  809.     public:
  810.  
  811.         AGADisclosureTriangleMA();
  812.         virtual ~AGADisclosureTriangleMA();
  813.  
  814.         // TControl-compatible I method
  815.         void IAGADisclosureTriangleMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  816.  
  817.         // MacApp overrides
  818.         virtual void DoPostCreate(TDocument* itsDocument);
  819.         virtual void Draw(const VRect& area);
  820.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  821.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  822.         virtual void DimState(Boolean state, Boolean redraw);
  823.         virtual void Dim();
  824.         virtual void SetEnable(Boolean state);
  825.  
  826.         AGADisclosureTriangle*    mAGAObject;
  827.  
  828.     protected:
  829.  
  830.         virtual void CreateAGAObject();
  831.     };
  832.  
  833. #pragma mark AGAProgressIndicatorMA
  834.  
  835. //
  836. // AGAProgressIndicatorMA ----------------------------------------------------
  837. //
  838. // TControl subclass. Access the AGAProgressIndicator directly. For
  839. // determinate progress, set the min/max range, and then call SetValue
  840. // or Increment repeatedly; you can also update the origin value if
  841. // desired. For indeterminate progress, set min=max and then call Animate
  842. // repeatedly.
  843. //
  844.  
  845. class AGAProgressIndicatorMA : public TControl
  846.     {
  847.     MA_DECLARE_CLASS;
  848.  
  849.     public:
  850.  
  851.         AGAProgressIndicatorMA();
  852.         virtual ~AGAProgressIndicatorMA();
  853.  
  854.         // TControl-compatible I method
  855.         void IAGAProgressIndicatorMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  856.  
  857.         // MacApp overrides
  858.         virtual void DoPostCreate(TDocument* itsDocument);
  859.         virtual void Draw(const VRect& area);
  860.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
  861.         virtual Boolean DoIdle(IdlePhase phase);
  862.         
  863.         // For an indeterminate progress indicator, you can use these functions
  864.         // to set it running or stop it. It will place itself on the cohandler
  865.         // chain and do a quantized animate at idle time.
  866.         void    StartAutoAnimate();
  867.         void    StopAutoAnimate();
  868.  
  869.         AGAProgressIndicator*    mAGAObject;
  870.  
  871.     protected:
  872.  
  873.         virtual void CreateAGAObject();
  874.     };
  875.  
  876. #pragma mark AGASeparatorMA
  877.  
  878. //
  879. // AGASeparatorMA ----------------------------------------------------
  880. //
  881. // TView subclass. The precise width or height is irrelevant; the
  882. // longer of the two dimensions determines the separator direction,
  883. // and the separator is drawn along the top or left edge.
  884. //
  885.  
  886. class AGASeparatorMA : public TView
  887.     {
  888.     MA_DECLARE_CLASS;
  889.  
  890.     public:
  891.  
  892.         AGASeparatorMA();
  893.         virtual ~AGASeparatorMA();
  894.  
  895.         // TView-compatible I method
  896.         void IAGASeparatorMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet);
  897.  
  898.         // MacApp overrides
  899.         virtual void DoPostCreate(TDocument* itsDocument);
  900.         virtual void Draw(const VRect& area);
  901.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  902.  
  903.         AGASeparator*    mAGAObject;
  904.  
  905.     protected:
  906.  
  907.         virtual void CreateAGAObject();
  908.     };
  909.  
  910. #pragma mark AGATargetBorderViewMA
  911.  
  912. //
  913. // AGATargetBorderViewMA ----------------------------------------------------
  914. //
  915. // TTargetBorderView replacement subclass.
  916. //
  917.  
  918. class AGATargetBorderViewMA : public TTargetBorderView
  919.     {
  920.     MA_DECLARE_CLASS;
  921.  
  922.     public:
  923.  
  924.         // TTargetBorderView-compatible I method
  925.         void IAGATargetBorderViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
  926.  
  927.         // MacApp overrides
  928.         virtual void DoPostCreate(TDocument* itsDocument);
  929.         virtual void Draw(const VRect& area);
  930.         virtual void ComputeBorderRegion(RgnHandle borderRegion);
  931.  
  932.     protected:
  933.  
  934.         RGBColor    mEnabledBackgroundColor;
  935.         RGBColor    mDisabledBackgroundColor;
  936.     };
  937.  
  938. #pragma mark AGANotchedTargetBorderViewMA
  939.  
  940. //
  941. // AGANotchedTargetBorderViewMA ----------------------------------------------------
  942. //
  943. // Same as AGATargetBorderViewMA, but with a "notched" bottom right corner.
  944. //
  945.  
  946. class AGANotchedTargetBorderViewMA : public AGATargetBorderViewMA
  947.     {
  948.     MA_DECLARE_CLASS;
  949.  
  950.     public:
  951.  
  952.         // TTargetBorderView-compatible I method
  953.         void IAGANotchedTargetBorderViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
  954.  
  955.         // MacApp overrides
  956.         virtual void ComputeBorderRegion(RgnHandle borderRegion);
  957.     };
  958.  
  959. #pragma mark AGATargetBorderFrameViewMA
  960.  
  961. //
  962. // AGATargetBorderFrameViewMA ----------------------------------------------------
  963. //
  964. // TTargetBorderView replacement subclass that also draws a
  965. // AGABorderFrameAdornerMA-type "3D" sunken frame. Provided
  966. // for convenience: makes it unnecessary to attach an
  967. // AGABorderFrameAdornerMA to the subview that this target
  968. // border view surrounds.
  969. //
  970.  
  971. class AGATargetBorderFrameViewMA : public AGATargetBorderViewMA
  972.     {
  973.     MA_DECLARE_CLASS;
  974.  
  975.     public:
  976.  
  977.         // TTargetBorderView-compatible I method
  978.         void IAGATargetBorderFrameViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
  979.  
  980.         // MacApp overrides
  981.         virtual void Draw(const VRect& area);
  982.         virtual void Dim();
  983.         virtual void SetEnable(Boolean state);
  984.     };
  985.  
  986. #pragma mark AGANotchedTargetBorderFrameViewMA
  987.  
  988. //
  989. // AGANotchedTargetBorderFrameViewMA ----------------------------------------------------
  990. //
  991. // Same as AGATargetBorderFrameViewMA, but with a "notched" bottom right corner.
  992. //
  993.  
  994. class AGANotchedTargetBorderFrameViewMA : public AGATargetBorderViewMA
  995.     {
  996.     MA_DECLARE_CLASS;
  997.  
  998.     public:
  999.  
  1000.         // TTargetBorderView-compatible I method
  1001.         void IAGANotchedTargetBorderFrameViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
  1002.  
  1003.         // MacApp overrides
  1004.         virtual void Draw(const VRect& area);
  1005.         virtual void Dim();
  1006.         virtual void ComputeBorderRegion(RgnHandle borderRegion);
  1007.     };
  1008.  
  1009. #pragma mark AGAGroupBoxMA
  1010.  
  1011. //
  1012. // AGAGroupBoxMA ----------------------------------------------------
  1013. //
  1014. // TCluster replacement subclass. Defaults to primary group box
  1015. // type.
  1016. //
  1017.  
  1018. class AGAGroupBoxMA : public TCluster
  1019.     {
  1020.     MA_DECLARE_CLASS;
  1021.  
  1022.     public:
  1023.  
  1024.         AGAGroupBoxMA();
  1025.         virtual ~AGAGroupBoxMA();
  1026.  
  1027.         // TCluster-compatible I method
  1028.         void IAGAGroupBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
  1029.  
  1030.         // MacApp overrides
  1031.         virtual void DoPostCreate(TDocument* itsDocument);
  1032.         virtual void Draw(const VRect& area);
  1033.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
  1034.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  1035.         virtual void DimState(Boolean state, Boolean redraw);
  1036.         virtual void Dim();
  1037.         virtual void SetLabel(const CStr255& theLabel, Boolean redraw);
  1038.  
  1039.         AGAGroupBox*    mAGAObject;
  1040.  
  1041.     protected:
  1042.  
  1043.         virtual void CreateAGAObject();
  1044.         
  1045.         Boolean    mIsPrimaryType;    // used by CreateAGAObject to instantiate desired type
  1046.     };
  1047.  
  1048. #pragma mark AGASecondaryGroupBoxMA
  1049.  
  1050. //
  1051. // AGASecondaryGroupBoxMA ----------------------------------------------------
  1052. //
  1053. // TCluster replacement subclass that overrides AGAGroupBoxMA to
  1054. // use secondary group box appearance.
  1055. //
  1056.  
  1057. class AGASecondaryGroupBoxMA : public AGAGroupBoxMA
  1058.     {
  1059.     MA_DECLARE_CLASS;
  1060.  
  1061.         AGASecondaryGroupBoxMA();
  1062.         virtual ~AGASecondaryGroupBoxMA();
  1063.  
  1064.         // TCluster-compatible I method
  1065.         void IAGASecondaryGroupBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
  1066.     };
  1067.  
  1068. #pragma mark AGATabPanelMA
  1069.  
  1070. //
  1071. // AGATabPanelMA ----------------------------------------------------
  1072. //
  1073. // TControl subclass for AGATabPanel set for large tabs. When instantiated
  1074. // from a view resource, the fUserArea, if non-zero, is used as the resource
  1075. // ID of an 'STR#' resource that contains the tab labels; the number of
  1076. // tabs will be the number of strings in the 'STR#' resource. If you have
  1077. // existing tabs, such as via the 'STR#', use InstallPanel to assign a
  1078. // panel to a tab. If you have no tabs yet, use AddPanel to create a new
  1079. // tab for a panel. Note that the panel views must be non-window 'View'
  1080. // resources, i.e. view hierarchies with a TView at the root, not a TWindow.
  1081. //
  1082.  
  1083. class AGATabPanelMA : public TControl
  1084.     {
  1085.     MA_DECLARE_CLASS;
  1086.  
  1087.     public:
  1088.  
  1089.         AGATabPanelMA();
  1090.         virtual ~AGATabPanelMA();
  1091.  
  1092.         // TControl-compatible I method
  1093.         void IAGATabPanelMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  1094.  
  1095.         // MacApp overrides
  1096.         virtual void DoPostCreate(TDocument* itsDocument);
  1097.         virtual void Draw(const VRect& area);
  1098.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  1099.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  1100.         virtual void DimState(Boolean state, Boolean redraw);
  1101.         virtual void Dim();
  1102.         virtual void SetEnable(Boolean state);
  1103.         
  1104.         // HandleTabSwitch can be used to switch to the specified panel,
  1105.         // but it will call ValidatePanel before allowing the switch.
  1106.         // This is what ClickSelf does to handle a click in a tab.
  1107.         // To switch directly without validation, just call SetValue.
  1108.         virtual void    HandleTabSwitch(SInt32 newTabIndex);
  1109.         
  1110.         // AddPanel adds another tab, and assigns it the specified 'View' view.
  1111.         // If the specified label StringPtr is NULL, the 'View' rsrc name is used.
  1112.         virtual void    AddPanel(SInt16 panelResourceID,
  1113.                                 StringPtr tabLabel);
  1114.  
  1115.         // InstallPanel assigns the specified 'View' view to the specified
  1116.         // existing tab. If the specified label StringPtr is NULL, the existing
  1117.         // tab label is left untouched.
  1118.         virtual void    InstallPanel(SInt32 tabIndex,
  1119.                                 SInt16 panelResourceID,
  1120.                                 StringPtr tabLabel);
  1121.  
  1122.         // GetPanelView returns the LView pointer to the root of the
  1123.         // pane hierarchy of the specified tab.
  1124.         virtual TView*    GetPanelView(SInt32 tabIndex);
  1125.         
  1126.         // SetSubviewsEnable is called by the SetEnable override
  1127.         // to walk all subviews of the currently installed panel
  1128.         // and set their enable state. Made public in case you
  1129.         // need to customize panel enabling behavior.
  1130.         virtual void    SetSubviewsEnable(Boolean state);
  1131.  
  1132.         AGATabPanel*    mAGAObject;
  1133.  
  1134.     protected:
  1135.  
  1136.         virtual void    CreateAGAObject();
  1137.         virtual void    CreateContainerView();
  1138.  
  1139.         virtual Boolean    ValidatePanel(SInt32 currentTabIndex);
  1140.  
  1141.         virtual void    SwitchPanels(SInt32 newTabIndex);
  1142.         virtual Boolean    SwitchPanelOut();    // returns true if panel contained target
  1143.         virtual void    SwitchPanelIn(SInt32 newTabIndex, Boolean targetInPanel);
  1144.         
  1145.         virtual void    DoSubviewsEnable(TView* aSuperView, Boolean state);
  1146.         
  1147.         TView*    mPanelContainerView;
  1148.         TView*    mActivePanelView;
  1149.     };
  1150.  
  1151. #pragma mark AGASmallTabPanelMA
  1152.  
  1153. //
  1154. // AGASmallTabPanelMA ----------------------------------------------------
  1155. //
  1156. // AGATabPanelMA (TControl) subclass for AGATabPanel set for small tabs.
  1157. //
  1158.  
  1159. class AGASmallTabPanelMA : public AGATabPanelMA
  1160.     {
  1161.     MA_DECLARE_CLASS;
  1162.  
  1163.     public:
  1164.  
  1165.         AGASmallTabPanelMA();
  1166.         virtual ~AGASmallTabPanelMA();
  1167.  
  1168.         // TControl-compatible I method
  1169.         void IAGASmallTabPanelMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  1170.  
  1171.     protected:
  1172.  
  1173.         virtual void CreateAGAObject();
  1174.     };
  1175.  
  1176. #endif // __GRAYCOUNCILMA__
  1177.  
  1178.